#!/usr/local/python/bin/python
# coding=utf-8
__author__ = 'Junjie.M'


class AppInfo():
    _data = []

    def setData(self, data):
        global _data
        _data = data

    def getAppCode(self):
        return _data['appCode']

    def getBizCode(self):
        return _data['bizCode']

    def getFilePath(self):
        return _data['filePath']

    def getHdfsPath(self):
        hdfsPath = _data['hdfsPath']
        if not hdfsPath or hdfsPath.strip() == '':
            dbName = _data['dbCode']
            if not dbName or dbName.strip() == '':
                hdfsPath = self.getHdfsDcpPath() + '/input'
            else:
                hdfsPath = self.getHdfsDcpPath() + '/input/' + dbName
        return hdfsPath

    def getHdfsDcpPath(self):
        return '/tmp/dcp'

    def getHdfsInputPath(self):
        return self.getHdfsDcpPath() + '/checkfile/input'

    def getHdfsOutputPath(self):
        return self.getHdfsDcpPath() + '/checkfile/output'

    def getFilePathType(self):
        return _data['filePathType']

    def getFileNameType(self):
        return _data['fileNameType']

    def getTmpPath(self):
        tmpPath = _data['tmpPath']
        if not tmpPath or tmpPath.strip() == '':
            dbName = _data['dbCode']
            if not dbName or dbName.strip() == '':
                tmpPath = self.getHdfsDcpPath() + '/input'
            else:
                tmpPath = self.getHdfsDcpPath() + '/input/' + dbName
        return tmpPath

    def getUsername(self):
        return _data['loginUser']

    def getPasswd(self):
        return _data['passwd']

    def getKeepDayNum(self):
        return _data['keepDayNum']

    def getKeepMonthNum(self):
        return _data['keepMonthNum']

    def getDbCode(self):
        return _data['dbCode']

